#!/bin/bash

PRG=$0
while [ -h "$PRG" ]; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
    if expr "$link" : '^/' 2> /dev/null >/dev/null; then
        PRG="$link"
    else
        PRG="`dirname "$PRG"`/$link"
    fi
done

_DIR=`dirname "$PRG"`

cd "$_DIR"

_CP="$_DIR/jmath.jar:$_DIR/lib/appframework-1.0.3.jar:$_DIR/lib/swing-worker-1.1.jar:$_DIR/lib/commons-logging-1.1.jar:$_DIR/lib/spring-context.jar:$_DIR/lib/spring-beans.jar:$_DIR/lib/spring-core.jar:$_DIR/lib/syntax.jar:$_DIR/lib/jfreechart-1.0.9.jar:$_DIR/lib/jcommon-1.0.12.jar:$_DIR/lib/colt.jar:$_DIR/lib/poi-3.0-rc4-20070503.jar:$_DIR/lib/flanagan.jar:$_DIR/lib/log4j-1.2.15.jar:$_DIR/lib/jruby.jar:$_DIR/lib/jruby-engine.jar:$_DIR/lib/jython.jar:$_DIR/lib/jython-engine.jar"

_CP="$_CP:$_DIR/lib/reflection.jar"


java -Xmx256m -classpath "$_CP" jmath.JMathApp
